﻿namespace AddressBook.Business.Contact
{
	#region "Using Statements"
	using System;
	using System.Collections.Generic;
	using System.Linq;
	using System.Text;

	using Csla;
	using Csla.Data;
	#endregion

	public class EventInfo : ReadOnlyBase<EventInfo>
	{
		#region "Business Methods"

		#region "Private Static Member Variables"

		private static PropertyInfo<int> IdProperty = RegisterProperty<int>(e => e.Id);
		private static PropertyInfo<string> FirstNameProperty = RegisterProperty<string>(e => e.Name);
    private static PropertyInfo<Int32> LocationIdProperty = RegisterProperty<Int32>(e => e.LocationId);

		#endregion

		#region "Public Properties"

		public int Id
		{
			get { return GetProperty(IdProperty); }
			private set { LoadProperty(IdProperty, value); }
		}

		public string Name
		{
			get { return GetProperty(FirstNameProperty); }
			private set { LoadProperty(FirstNameProperty, value); }
		}

    public Int32 LocationId
    {
      get { return GetProperty(LocationIdProperty); }
      private set { LoadProperty(LocationIdProperty, value); }
    }

		#endregion

		public override string ToString()
		{
			return this.Name;
		}

		#endregion

		#region "Constructors"

		internal EventInfo(int id, string name, Int32 locationId)
		{
			this.Id = id;
			this.Name = name;
      this.LocationId = locationId;
		}

		#endregion
	}
}